<template>
  <div>
    <input type="text" v-focus />
  </div>
</template>

<script>
import { ref } from "vue";

export default {
  // 局部指令
  directives: {
    focus: {
      mounted(el, bindings, vnode, preVnode) {
        el.focus();
      },
    },
  },
};
</script>

<style scoped></style>
